package com.platform.open.enums;

import com.platform.comm.enums.IDictEntry;
import com.platform.comm.enums.IEnumItem;

/**
 * @author liujizheng
 * @version 1.0
 * @ClassName ServiceCreateType
 * @Description 服务鉴权方式
 * @date 2021/5/27 11:07
 */
public enum AuthWay implements IDictEntry, IEnumItem {
    /**
     * 自定义鉴权方式
     */
    CUSTOM("CUSTOM", "自定义"),
    /**
     * 系统默认鉴权方式
     */
    SYSTEM("SYSTEM", "系统默认");

    private final String key;
    private final String title;

    AuthWay(String key, String title) {
        this.key = key;
        this.title = title;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.title;
    }

    @Override
    public Object getData() {
        return this;
    }

    @Override
    public boolean is(String code) {
        return this.name().equals(code);
    }
}
